from web import app
from flask import request,render_template
from web.service import custom_service

#跳转到定制类数据页面
#goods_type_id:页面上传递的值，1:隐形眼镜，2：避孕套，3:美瞳,4:玻尿酸
@app.route('/data/custom/<goods_type_id>',methods=['GET'])
def flask_bootstrap_test(goods_type_id):
    str = "/data/yxyj.html"
    title='隐形眼镜'
    if('2' == goods_type_id):
        str = '/data/byt.html'
        title='避孕套'
    if('3' == goods_type_id):
        str = '/data/mt.html'
        title='美瞳'
    if('4' == goods_type_id):
        str = '/data/bns.html'
        title='玻尿酸'
    return render_template(str,title=title,goods_type_id=goods_type_id)

@app.route('/data/custom/getData',methods=['POST'])
def getData():
    customService = custom_service.customService()
    return customService.getData(request)
